<%-- 
    Document   : login
    Created on : 2014-3-21, 10:52:23
    Author     : lcfgly
--%>
<%@page import="java.net.URLDecoder"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@page trimDirectiveWhitespaces="true" %>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%
    Cookie[] cookies = request.getCookies();
    Cookie sCookie = null;
    if (cookies != null) {
        for (int i = 0; i < cookies.length; i++) {
            sCookie = cookies[i];
            if (sCookie.getName().equals("reuser")) {
                request.setAttribute("reuser", URLDecoder.decode(sCookie.getValue(), "utf-8"));
            } else if (sCookie.getName().equals("repwd")) {
                request.setAttribute("repwd", URLDecoder.decode(sCookie.getValue(), "utf-8"));
            }
        }
    }
%>
<!DOCTYPE html>
<html lang="en">
    <head>
        <title>用户登入</title><meta charset="UTF-8" />
        <meta name="viewport" content="width=device-width, initial-scale=1.0" />
        <link rel="stylesheet" href="<c:url value="/css/logincss/bootstrap.min.css" />" />
        <link rel="stylesheet" href="<c:url value="/css/logincss/bootstrap-responsive.min.css" />" />
        <link rel="stylesheet" href="<c:url value="/css/logincss/matrix-login.css" />" />
        <link href="<c:url value="/css/logincss/font-awesome/css/font-awesome.css" />" rel="stylesheet" />
    </head>
    <body style="margin-top: 5%;">
        <div id="loginbox">
            <div class="alert alert-success alert-block"> <a href="#" data-dismiss="alert" class="close" id="errorclose">×</a>
                <h4 class="alert-heading " style="text-align: center">公告</h4>
                <span style="margin-left:30px">系统更新修复已完成.新增地图定位功能！更新修复内容及新功能操作方式详情请看: <a href="http://img.mp189.com/515.docx" style="color:red;">更新日志【必看】</a></span><br />
            </div>
            <c:if test="${!empty error}">
                <div class="alert alert-error alert-block"> <a href="#" data-dismiss="alert" class="close" id="errorclose">×</a>
                    <h4 class="alert-heading">警告!</h4>
                    <span style="margin-left:30px">${error.username}</span><br />
                    <span style="margin-left:30px">${error.password}</span><br />
                </div>
            </c:if>
            <form id="loginform" class="form-vertical" method="post" >
                <div class="control-group normal_text"> <h3>商家报价系统</h3></div>
                <div class="control-group">
                    <div class="controls">
                        <div class="main_input_box">
                            <span class="add-on bg_lg"><i class="icon-user"></i></span><input type="text" name="username" value="${reuser}" placeholder="用户名" />
                        </div>
                    </div>
                </div>
                <div class="control-group">
                    <div class="controls">
                        <div class="main_input_box">
                            <span class="add-on bg_ly"><i class="icon-lock"></i></span><input type="password" name="password" value="${repwd}" placeholder="密码" />
                        </div>
                    </div>
                </div>
                <div class="control-group">
                    <div class="controls">
                        <div class="main_input_box">
                            <input type="text" placeholder="验证码" style="width:30%;float:left;margin-left:20px;" name="vcode"><img src="<c:url value="/vcode.html" />" alt="看不清？点击更换" style="cursor: pointer;" onclick="changeAuthCode()" id="vdimgck">
                        </div>
                    </div>
                </div>
                <div class="form-actions">
                    <!--<span class="pull-left"><a href="#" class="flip-link btn btn-info" id="to-recover">注册</a></span>-->
                    <span class="pull-left" style="color: #FFFFFF"><input type="checkbox" style="width:20px;margin-top: 0px;" name="reuser" <c:if test="${!empty reuser}">checked="checked"</c:if>/>记住帐号</span>
                    <span class="pull-left" style="color: #FFFFFF;margin-left: 10px;"><input type="checkbox" style="width:20px;margin-top: 0px;" name="repwd" <c:if test="${!empty repwd}">checked="checked"</c:if>>记住密码</span>
                        <span class="pull-right"><button class="btn btn-success" type="submit" />登入</button></span>
                    </div>
                </form>
                <!--<form id="recoverform" action="#" class="form-vertical">
                    <p class="normal_text">请填写邮箱找回密码</p>
    
                    <div class="controls">
                        <div class="main_input_box">
                            <span class="add-on bg_lo"><i class="icon-envelope"></i></span><input type="text" placeholder="E-mail address" />
                        </div>
                    </div>
    
                    <div class="form-actions">
                        <span class="pull-left"><a href="#" class="flip-link btn btn-success" id="to-login">&laquo; Back to login</a></span>
                        <span class="pull-right"><a class="btn btn-info"/>Reecover</a></span>
                    </div>style="position: relative;float: left;margin-left: 10px;top: -405px;width:400px;"
                </form>-->
            </div>

            <script src="<c:url value="/js/controller/jquery.min.js" />"></script>  
        <script src="<c:url value="/js/controller/matrix.login.js" />"></script> 
        <script type="text/javascript">
                                function changeAuthCode() {
                                    var num = new Date().getTime();
                                    var rand = Math.round(Math.random() * 10000);
                                    num = num + rand;
                                    $('#ver_code').css('visibility', 'visible');
                                    if ($("#vdimgck")[0]) {
                                        $("#vdimgck")[0].src = "<c:url value="/vcode.html" />?tag=" + num;
                                    }
                                    return false;
                                }
                                $(document).ready(function() {
                                    $("#errorclose").click(function() {
                                        $(this).parent("div").remove();
                                    });
                                });
        </script>
    </body>

</html>
